﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domep.Server.BusinessObjects;

namespace Domep.Server.Kernel.DBCommunication
{
    public class ApplianceRetriever
    {
        /*private ServerContext db;
        public ApplianceRetriever()
        {
            db = new ServerContext();
        }*/

        public List<Appliance> GetAppliances()
        {

            List<Appliance> appliances = new List<Appliance>();
            
            //TODO Implémenter ici le vrai protocol
            
            List<Functionality> functionalities = new List<Functionality>();
            Functionality f1 = new Functionality("Allumer", "Allumer l'appareil", "Signature1");
            Functionality f2 = new Functionality("Eteindre", "Eteins l'appareil", "Signature2");
            Functionality f3 = new Functionality("Fourer", "Foure", "Signature3");
            Functionality f4 = new Functionality("MicroOnder", "Microonde", "Signature4");

            functionalities.Add(f1);
            functionalities.Add(f2);
            functionalities.Add(f3);

            appliances.Add(new Appliance(new System.Net.IPAddress(0X2414188f),"00-11-22-33-44-55","Four",new ApplianceModel("Four","MarqueDuFour",ApplianceType.Oven,functionalities),"ReferenceDuFour","SerialNumberDuFour",1,1));

            functionalities = new List<Functionality>();
            functionalities.Add(f1);
            functionalities.Add(f2);
            functionalities.Add(f4);
            appliances.Add(new Appliance(new System.Net.IPAddress(0X2414188f), "11-22-33-44-55-66", "Micro-Ondes", new ApplianceModel("Micro-Ondes", "MarqueDuMicroOndes", ApplianceType.MicrowaveOven, functionalities), "ReferenceDuMicroOndes", "SerialNumberDuMicroOndes", 2, 2));
             
           
            //return new List<Appliance>(db.Appliances);
            return appliances;
        }
    }
}
